home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 August / PC Plus SuperCD 50a Issue 142 (CD142a) (August 1998).iso / trial / demon / TURNPIKE.1 / CLASSES.ZIP / JAVA / IO / FileInputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-04-14  |  1.2 KB  |  69 lines

  1. package java.io;
  2.  
  3. public class FileInputStream extends InputStream {
  4.    // $FF: renamed from: fd java.io.FileDescriptor
  5.    private FileDescriptor field_0;
  6.  
  7.    public FileInputStream(String var1) throws FileNotFoundException {
  8.       SecurityManager var2 = System.security;
  9.       if (var2 != null) {
  10.          var2.checkRead(var1);
  11.       }
  12.  
  13.       try {
  14.          this.field_0 = new FileDescriptor();
  15.          this.open(var1);
  16.       } catch (IOException var3) {
  17.          throw new FileNotFoundException(var1);
  18.       }
  19.    }
  20.  
  21.    public FileInputStream(File var1) throws FileNotFoundException {
  22.       this(var1.getPath());
  23.    }
  24.  
  25.    public FileInputStream(FileDescriptor var1) {
  26.       SecurityManager var2 = System.security;
  27.       if (var2 != null) {
  28.          var2.checkRead(var1);
  29.       }
  30.  
  31.       this.field_0 = var1;
  32.    }
  33.  
  34.    private native void open(String var1) throws IOException;
  35.  
  36.    public native int read() throws IOException;
  37.  
  38.    private native int readBytes(byte[] var1, int var2, int var3) throws IOException;
  39.  
  40.    public int read(byte[] var1) throws IOException {
  41.       return this.readBytes(var1, 0, var1.length);
  42.    }
  43.  
  44.    public int read(byte[] var1, int var2, int var3) throws IOException {
  45.       return this.readBytes(var1, var2, var3);
  46.    }
  47.  
  48.    public native long skip(long var1) throws IOException;
  49.  
  50.    public native int available() throws IOException;
  51.  
  52.    public native void close() throws IOException;
  53.  
  54.    public final FileDescriptor getFD() throws IOException {
  55.       if (this.field_0 != null) {
  56.          return this.field_0;
  57.       } else {
  58.          throw new IOException();
  59.       }
  60.    }
  61.  
  62.    protected void finalize() throws IOException {
  63.       if (this.field_0 != null) {
  64.          this.close();
  65.       }
  66.  
  67.    }
  68. }
  69.